Skip to content

feat(config): accept an object for launch args - #1903

Merged
kdy1 merged 21 commits into
e2e-inc:mainfrom
luke-h1:@luke-h1/feat/launch-arguments
Nov 24, 2026
Merged

kdy1 merged 21 commits into
e2e-inc:mainfrom
luke-h1:@luke-h1/feat/launch-arguments

Conversation

@luke-h1

@luke-h1 luke-h1 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Part of #1855, the app: { launchArguments: { AppleLocale: 'fr_FR' } } row.

  • app.launchArguments now supports { name: value } as well as the list of strings. Detox and Maestro suites have a map to port, and AppleLanguages: ['fr'] is easier to write than '-AppleLanguages', '(fr)'.
  • A value is a string, number, boolean, or list of strings. Core checks the shape at config load: packages/core/src/config/app.ts.
  • mobile() writes each entry for its platform in packages/mobile/src/launch-arguments.ts: -name value on iOS, and on Android an am start extra of the value's type (--ez, --ei, --ef, --es, --esa), so the app reads it with the matching Intent getter. An object with one of Apple's keys on an Android target fails at config load.
  • device.openApp(app, { launchArguments }) takes the same object form and checks it the way config load does, with INVALID_ARGUMENT. The shape check is checkLaunchArguments, exported from @e2e-dev/core/engine.
  • Android cannot carry every list: am start --esa splits on each comma, keeps the backslash before an escaped one, and reads an empty value as one empty item. An object's list on Android is refused when it is empty or an item is empty, holds a comma, or ends in a backslash. An iOS string value goes out as a plist string, so '(draft)' reaches the app as text, not an array. Core refuses a number beyond 2^53 and a NUL character.
  • The list still goes to the launch command as it did, with three changes, each a loud failure: the config error for a non-string list item has new text, a list item with a NUL character now fails at config load, and a list passed to device.openApp is now shape-checked.
  • The engine contract stays backward compatible. EngineAppInfo.launchArguments is still readonly string[], so an engine that spreads it keeps working, including published @e2e-dev/mobile 0.12.8, whose peer ranges admit this core. The object goes to a new field, EngineAppInfo.launchArgumentValues, only for an engine that declares launchArgumentValues: true (defineEngine, the engine manifest, and its schema). Any other engine gets INVALID_CONFIG at config load and never sees the object. mobile() and desktop() opt in.

IOS changes:

// before and still valid
launchArguments: ['-AppleLanguages', '(fr)', '-AppleLocale', 'fr_FR'],

// new
launchArguments: { AppleLanguages: ['fr'], AppleLocale: 'fr_FR' },

Android changes:

// before and still valid
launchArguments: ['--ez', 'e2e', 'true'],

// new
launchArguments: { e2e: true },

^ this change wasn't asked for in this proposed API but I thought it'd be a good quality of life improvement for the Android side. Let me know if it should be taken out 👍

Issue

feature: #1855 device and app app: { launchArguments: { AppleLocale: 'fr_FR' } }

Verified

Ran it locally: yes

  • Re-run after the engine contract review, Node 24.19.0, at 7f4a2f21 (5a7b87a1 after it changes only docs and the changeset; docs:check and check:changeset-bumps green there):

    • pnpm check green. pnpm test green (8558 tests across 22 vitest runs, none failed).

    • The reviewer's case against the packed @e2e-dev/core and e2e in a scratch project:

      Engine List { AppleLocale: 'fr_FR', AppleLanguages: ['fr'] }
      custom engine whose init spreads app.launchArguments e2e run passes, init gets ["-AppleLocale","fr_FR","-AppleLanguages","(fr)"] INVALID_CONFIG at config load, exit 2, init never runs
      published @e2e-dev/mobile@0.12.8 e2e list loads INVALID_CONFIG at config load, exit 2

      tsc accepts the unchanged [...(info.app.launchArguments ?? [])] against the new declaration.

    • New tests: engine-protocol.test.ts "hands an engine that predates the object form a list it can spread, and refuses an object at config load" and "carries the object form to an engine that declares launchArgumentValues" (over the loopback protocol). The mobile and desktop engine tests assert the opt-in; removing either launchArgumentValues: true fails them.

  • On devices, with a hand-run check that lived in the mobile benchmark while this was developed and is no longer in the PR (CI never ran it, and dumpsys shows only (has extras) on Android): an iPhone simulator (iOS 26.5) and a Pixel 7 emulator, Release builds, the object and the list forms producing the same launch. The simulator process ran as e2eBenchmark -AppleLanguages (fr) -AppleLocale fr_FR; the emulator's launch intent carried the extras. The Android half ran again after 0aae6136 with --ez.

  • The full gate on the final tree, rebased on main: pnpm check green, translation check included (the docs/ja and docs/zh pages carry the changed code blocks and the new heading, their prose untouched); pnpm test under Node 24 green across every package (the e2e package alone: 4870 passed, 11 skipped).

  • Re-run after the last review, Node 24.19.0. The benchmarks and device runs below ran at 209b49fa plus the last two commits' changes, before the rebase on main. After the rebase, pnpm check and pnpm test ran again at 3822804f, both green (8479 tests across 22 vitest runs):

    • Before the rebase: pnpm check green. pnpm test green (8062 tests across 22 vitest runs). pnpm test:testbed 600 passed, 1 skipped. pnpm test:web-benchmark 95 passed.

    • CI=1 pnpm --filter @e2e-dev/web-benchmark run test:agent --strict-cache: 26 passed, 8 failed. Same 8 fail on the merge base 6fdb1c27: 5 steps have no recording and call the model (no key on this machine), 3 planted-bug judgments the same way.

    • pnpm test:mobile-benchmark, Release builds of the app: iPhone 17 Pro simulator (iOS 26.5) 61 passed, 1 skipped. Pixel 7 emulator (Android 36, google_apis_playstore) 59 passed, 1 failed, 1 skipped. The failure is device.e2e.ts "a denied prompt recovers once the permission is granted outside" (alert dismiss did not dismiss the visible alert). No launch arguments in it, and it flakes the same on the merge base with the same APK and emulator (2 of 4 runs fail there, 2 of 3 here).

    • A launch with an object from the config and from device.openApp({ relaunch: true, launchArguments }) on both devices. iOS process (ps):

      config:  -AppleLanguages (fr) -AppleLocale fr_FR -flag NO -on YES -retries 3 -negative "-1" -spaced "a b" -paren "(draft)" -cdn "//cdn" -blank "" -tags ("", a, "x,y", "//cdn.example/assets")
      openApp: -note "-1" -count 7
      

      Android am start (agent-device's adb calls, recorded through a wrapper):

      config:  --ez on true --ei retries 3 --ei max 2147483647 --el big 2147483648 --ef ratio 1.5 --es spaced 'a b' --es paren '(draft)' --es empty '' --esa tags 'a,b c'
      openApp: --es note -1 --ei count 7
      
  • unit tests:

$ pnpm --filter @e2e-dev/mobile exec vitest run tests/unit/launch-arguments.test.ts
✓ launchArgumentList > passes a list through as given and sends nothing for none
✓ launchArgumentList > spells an object as iOS process arguments
✓ launchArgumentList > quotes a string NSUserDefaults would otherwise read as a plist, as a value and as a list item
✓ launchArgumentList > spells an object as am start extras of each value's type
✓ assertLaunchArgumentsFor > refuses Apple's arguments in an object on Android, and nothing else
✓ assertLaunchArgumentsFor > refuses a list am start would read back changed on Android, and takes any list on iOS
✓ assertLaunchArgumentsFor > fails a launch a test asked for with INVALID_ARGUMENT
✓ launchArgumentsForOpen > checks the declared shape and the platform rules, and leaves out an undefined value
Tests  8 passed (8)

$ pnpm --filter @e2e-dev/mobile exec vitest run tests/unit/engine.test.ts -t "launch"
✓ manifest > refuses an iOS launch argument in an object on an Android target, and passes a list through
✓ device fixture > spells a launch-argument object for the platform on every fresh launch of the pinned app, and sends nothing for an empty object
✓ device fixture > launches any app with its own arguments, a list or an object spelled for the platform, and permissions set on that app by name
✓ device fixture > refuses openApp launch arguments of the wrong shape, or ones Android cannot carry, before any device command

$ pnpm --filter e2e exec vitest run tests/unit/config.test.ts -t "launch arguments"
✓ resolveConfig > takes launch arguments as an object of name to string, number, boolean, or list of strings, and leaves out an undefined value

Checklist

  • Changeset added (pnpm changeset) for any change to a published package, or the change is testbed, docs, or CI only.
  • Breaking change: title carries !, the changeset body names what breaks and what replaces it, and the deprecation warning landed a window earlier (stability policy in CONTRIBUTING.md).
  • Docs updated in the same PR: the docs/**/*.mdx page for the behavior, and skills/e2e/ if the skill describes it.
  • Contract change: emitted .d.ts reviewed, tests/types/sdk-types.ts updated; wire change edits the schema and the valid fixture (launchArgumentValues is a plain boolean, so the invalid fixture needs no change).
  • Engine contract change (e2e/engine): changesets for e2e, @e2e-dev/core, @e2e-dev/mobile, and @e2e-dev/desktop. @e2e-dev/web has no change: it never receives launch arguments.

View guided diff

@github-actions github-actions Bot added the size:L Up to 499 changed lines, not counting tests, fixtures, translated docs, or the lockfile label Nov 17, 2026
@luke-h1
luke-h1 marked this pull request as ready for review November 17, 2026 20:47

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 27 files

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

View guided diff | Re-trigger cubic

Comment thread packages/mobile/src/launch-arguments.ts Resolved
Comment thread docs/mobile.mdx Resolved
Comment thread packages/core/src/config/app.ts Resolved
Comment thread .changeset/launch-arguments-object.md Resolved
Comment thread docs/reference/config.mdx Resolved
Comment thread docs/reference/config.mdx Resolved
Comment thread docs/migrate/maestro.mdx Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 15 files (changes from recent commits).

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

View guided diff | Re-trigger cubic

Comment thread packages/mobile/src/launch-arguments.ts Resolved

@okwasniewski okwasniewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[claude-opus-5-5] automated review on behalf of @okwasniewski

Checked 84a7c01 (plus a local merge with current main): read the diff, ran the new and touched unit tests, typecheck, oxlint, the docs translation check, mutation-checked the new tests, and probed the encoder directly. Thanks for the careful PR, the core validation and tests are solid. One maintainer call on the Android side (below), plus a couple of fixes.

Must fix

  • docs/mobile.mdx:85 says { e2e: true } is --es e2e true on Android. The code (and the reference table) sends --ez e2e true. Should read --ez.
  • docs/ja/* and docs/zh/* are not mirrored. After merging main, node scripts/check-docs-translations.ts fails on mobile.mdx code block #7, reference/config.mdx #27 (a new block), reference/engine.mdx #34, reference/mobile.mdx #51, in both languages (main passes). Copy the changed code blocks into the ja and zh pages (the table rows and prose can stay in their language or follow later). This branch is based on a main from before the translations landed, so rebase first.

Should fix

  • packages/mobile/src/surface.ts:871 - device.openApp validates permissions at runtime but not launchArguments. With the object form, a JS caller passing { x: null } (or a nested object) gets TypeError: Cannot read properties of null (reading 'map') from iosArgument instead of an INVALID_ARGUMENT. The Android Apple-name check from validateApp is also skipped there, so openApp(id, { launchArguments: { AppleLocale: 'fr_FR' } }) on Android silently sends --es AppleLocale fr_FR. Suggest moving the shape check out of config/app.ts into one helper exported from @e2e-dev/core/engine (same as how assertPermissions serves both paths), and call it plus assertLaunchArgumentsFor from openApp with INVALID_ARGUMENT.
  • packages/mobile/src/launch-arguments.ts:84 - the Android number flag depends on the value, not on what the app reads. JS has no int/float distinction, so { ratio: 1.0 } sends --ei ratio 1 and an app calling getFloatExtra("ratio", 0f) gets 0. { id: 3_000_000_000 } flips to --el, so getIntExtra misses it, and 1e19 sends --el 10000000000000000000, which am fails to parse (cubic's open finding, it is real). Pending the decision below, the least surprising shape is: integers in Java int range as --ei, anything else INVALID_CONFIG pointing at the list form (['--ef', 'ratio', '1.0'], ['--el', ...]).

Nits

  • IOS_ONLY_ARGUMENTS is a hand list (misses e.g. AppleKeyboards, AppleMeasurementUnits, AppleTemperatureUnit, AppleFirstWeekday) and only guards the object form. Fine as a helpful error, just know it will drift.
  • docs/migrate/detox.mdx:46 "with the same keys": true on iOS; a Detox Android app reads launch args from instrumentation arguments, so the app code changes to Intent extras either way. Worth half a sentence.
  • apps/mobile-benchmark/tests-launch-arguments is hand-run only and the Android half asserts just (has extras). The unit tests already pin the spelling; consider dropping the extra config + script rather than carrying a check CI never runs.

Verified

  • @e2e-dev/mobile launch-arguments.test.ts + engine.test.ts: 249 passed. e2e config.test.ts: 100 passed. Typecheck clean for e2e (incl. tests/types/sdk-types.ts), @e2e-dev/core, @e2e-dev/mobile, @e2e-dev/mobile-benchmark. pnpm lint clean.
  • Mutants, each caught: --ez -> --es (2 fail), iOS YES/NO -> true/false (3 fail), drop --esa comma escaping (1 fail), drop the validateApp Android check (1 fail), pass the object to launchArgs unspelled (2 fail), drop Number.isFinite (1 fail), drop the undefined skip (1 fail).
  • Direct probe: launchArgumentList('android', { ratio: 1.0, big: 1e19 }) -> ['--ei', 'ratio', '1', '--el', 'big', '10000000000000000000'].
  • agent-device 0.21.38 quotes each am start argv element, so string values with spaces and --esa escaped commas reach am intact.
  • Earlier cubic findings are addressed at this head except the --el range one (real, folded into the should-fix above).
  • CI: only the light checks ran (check, label, drop, cubic: all green); the full test workflows have not run on this fork PR yet.

The Android object-form mapping (typed extras vs ints only vs iOS-only vs all strings) waits on the maintainer; the must-fixes and the openApp validation can land now.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 19 files (changes from recent commits).

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

View guided diff | Re-trigger cubic

Comment thread packages/core/src/engine/index.ts Resolved
Comment thread docs/reference/engine.mdx Resolved
Comment thread docs/reference/engine.mdx Resolved
Comment thread docs/reference/config.mdx Resolved
Comment thread packages/mobile/src/launch-arguments.ts Resolved
@luke-h1
luke-h1 force-pushed the @luke-h1/feat/launch-arguments branch from 8d1739e to a2e4e59 Compare November 17, 2026 22:51
@github-actions github-actions Bot added size:XL Up to 999 changed lines, not counting tests, fixtures, translated docs, or the lockfile and removed size:L Up to 499 changed lines, not counting tests, fixtures, translated docs, or the lockfile labels Nov 17, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 8 files (changes from recent commits).

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

Requires human review: Auto-approval skipped because cubic reviewed only this push, not the earlier force-push. Comment @cubic review to review the whole pull request.

View guided diff | Re-trigger cubic

Comment thread docs/ja/reference/config.mdx Resolved
Comment thread docs/zh/reference/config.mdx Resolved
Comment thread docs/zh/reference/config.mdx Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 13 files (changes from recent commits).

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

Requires human review: Auto-approval blocked by 8 unresolved issues from previous reviews.

View guided diff | Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 3 files (changes from recent commits).

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

Requires human review: Auto-approval blocked by 2 unresolved issues from previous reviews.

View guided diff | Re-trigger cubic

@luke-h1

luke-h1 commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor Author

[claude-opus-5-5] automated review on behalf of @okwasniewski

Checked 84a7c01 (plus a local merge with current main): read the diff, ran the new and touched unit tests, typecheck, oxlint, the docs translation check, mutation-checked the new tests, and probed the encoder directly. Thanks for the careful PR, the core validation and tests are solid. One maintainer call on the Android side (below), plus a couple of fixes.

Must fix

Should fix

  • packages/mobile/src/surface.ts:871 - device.openApp validates permissions at runtime but not launchArguments. With the object form, a JS caller passing { x: null } (or a nested object) gets TypeError: Cannot read properties of null (reading 'map') from iosArgument instead of an INVALID_ARGUMENT. The Android Apple-name check from validateApp is also skipped there, so openApp(id, { launchArguments: { AppleLocale: 'fr_FR' } }) on Android silently sends --es AppleLocale fr_FR. Suggest moving the shape check out of config/app.ts into one helper exported from @e2e-dev/core/engine (same as how assertPermissions serves both paths), and call it plus assertLaunchArgumentsFor from openApp with INVALID_ARGUMENT.
  • packages/mobile/src/launch-arguments.ts:84 - the Android number flag depends on the value, not on what the app reads. JS has no int/float distinction, so { ratio: 1.0 } sends --ei ratio 1 and an app calling getFloatExtra("ratio", 0f) gets 0. { id: 3_000_000_000 } flips to --el, so getIntExtra misses it, and 1e19 sends --el 10000000000000000000, which am fails to parse (cubic's open finding, it is real). Pending the decision below, the least surprising shape is: integers in Java int range as --ei, anything else INVALID_CONFIG pointing at the list form (['--ef', 'ratio', '1.0'], ['--el', ...]).

Nits

  • IOS_ONLY_ARGUMENTS is a hand list (misses e.g. AppleKeyboards, AppleMeasurementUnits, AppleTemperatureUnit, AppleFirstWeekday) and only guards the object form. Fine as a helpful error, just know it will drift.
  • docs/migrate/detox.mdx:46 "with the same keys": true on iOS; a Detox Android app reads launch args from instrumentation arguments, so the app code changes to Intent extras either way. Worth half a sentence.
  • apps/mobile-benchmark/tests-launch-arguments is hand-run only and the Android half asserts just (has extras). The unit tests already pin the spelling; consider dropping the extra config + script rather than carrying a check CI never runs.

Verified

  • @e2e-dev/mobile launch-arguments.test.ts + engine.test.ts: 249 passed. e2e config.test.ts: 100 passed. Typecheck clean for e2e (incl. tests/types/sdk-types.ts), @e2e-dev/core, @e2e-dev/mobile, @e2e-dev/mobile-benchmark. pnpm lint clean.
  • Mutants, each caught: --ez -> --es (2 fail), iOS YES/NO -> true/false (3 fail), drop --esa comma escaping (1 fail), drop the validateApp Android check (1 fail), pass the object to launchArgs unspelled (2 fail), drop Number.isFinite (1 fail), drop the undefined skip (1 fail).
  • Direct probe: launchArgumentList('android', { ratio: 1.0, big: 1e19 }) -> ['--ei', 'ratio', '1', '--el', 'big', '10000000000000000000'].
  • agent-device 0.21.38 quotes each am start argv element, so string values with spaces and --esa escaped commas reach am intact.
  • Earlier cubic findings are addressed at this head except the --el range one (real, folded into the should-fix above).
  • CI: only the light checks ran (check, label, drop, cubic: all green); the full test workflows have not run on this fork PR yet.

The Android object-form mapping (typed extras vs ints only vs iOS-only vs all strings) waits on the maintainer; the must-fixes and the openApp validation can land now.

[claude-fable-5-1] automated reply on behalf of @luke-h1 (drafted with Claude, reviewed by @luke-h1)

Thanks for the pass. Rebased on main

Done: the --es/--ez line, the Apple names you listed (the comment now says the list isn't exhaustive, so an unlisted name passes), the Detox sentence, and the benchmark check is gone.

openApp: validates launchArguments the way you suggested. The shape check moved to core as checkLaunchArguments, exported from @e2e-dev/core/engine, and openApp runs it plus the Android rules with INVALID_ARGUMENT before any device command. Both your cases are covered by tests: { x: null } and a nested object fail the shape check, { AppleLocale: 'fr_FR' } on Android fails the platform check.

Numbers: 1e19 can't reach --el any more, core refuses anything beyond 2^53 - 1 at config load and on openApp. 1.0 -> --ei and 3e9 -> --el still do what you describe. Left the mapping alone until you pick, ints-only is a small change and I'll do it as soon as you say.

One thing that contradicts your run: the --esa comma escaping never worked. Intent.parseCommandArgs splits with value.split("(?<!\\\\),") and never strips the backslash, so a\,b arrives as the literal string a\,b. The test was pinning the wrong output. Replaced it with refusals: on Android an object's list can't be empty, and no item can be empty, hold a comma, or end in a backslash. Same commit: iOS string values go out as plist strings so '(draft)' arrives as text, and a later pass caught the type refusing { token: process.env.TOKEN } while the runtime dropped it.

ja/zh: copied the changed code blocks, the checkLaunchArguments heading, and the summary table's type cell into both, prose untouched

@okwasniewski okwasniewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[claude-opus-5-5] automated review on behalf of @okwasniewski

Re-checked 9e6c141 (and a local merge with main 66d07ca, clean). Every ask from the last review is done: --ez in docs/mobile.mdx, ja/zh code blocks mirrored (translation check passes), device.openApp now runs checkLaunchArguments plus the Android rules with INVALID_ARGUMENT before any device command, 1e19 can't reach --el any more (2^53 bound), Apple list widened, Detox sentence added, hand-run benchmark check dropped. You're right about --esa: Intent.parseCommandArgs never strips the backslash, so refusing comma/backslash/empty items is the right fix. Thanks.

Must fix

  • packages/mobile/src/launch-arguments.ts:91 and :98 - on iOS, a value that starts with - gets dropped. NSUserDefaults reads -offset -1 as two keys, so { offset: -1 } or { mode: '-x' } reaches the app as nil, and nothing reports it. I checked this with a Foundation binary on the macOS host (same CFPreferences argument parser): ./p -n -1 gives n = nil, ./p -n '"-1"' gives n = "-1", and -l '(-1, b)' works because list items are fine. Fix: send numbers through plistString too, and quote any string that starts with - (for example, drop - from the leading character PLIST_UNQUOTED allows). Add -1 and '-x' iOS cases to launch-arguments.test.ts.

Should fix

  • packages/core/src/types.ts:1259 - LaunchArguments allows undefined values, and EngineAppInfo.launchArguments and the resolved app use that same type, even though checkLaunchArguments already strips them. So every engine still has to handle value === undefined (launchArgumentList and assertLaunchArgumentsFor both do). Have checkLaunchArguments return a narrower resolved type (readonly string[] | Readonly<Record<string, LaunchArgumentValue>>) and use it for EngineAppInfo, ResolvedApp, and the value launchArgumentsForOpen returns. Keep the wide type only on input (TargetApp, OpenAppOptions). Then the engine-side undefined branches go away.

Nits

  • packages/core/src/internal/launch-arguments.ts:60 - the array branch of isLaunchArgumentValue never runs, because checkLaunchArguments handles arrays before it gets there. Narrow the function to scalars.
  • fail(code, message) appears twice, in core and mobile. Fine for now, but if a third copy shows up, export it from core.
  • docs/migrate/detox.mdx:46 - Detox on Android puts launch args into the activity intent as string values inside a launchArgs bundle extra (getIntent().getBundleExtra("launchArgs"), see ActivityLaunchHelper.kt in detox 20.51.4), not only as instrumentation arguments. Something like "Detox nests them as strings in a launchArgs bundle" would be more exact.
  • The changeset covers internals (plist quoting rules, the checkLaunchArguments export). It could stop at the object form, the per-platform spelling, and the Android refusals.

Verified

  • On the merge with main: @e2e-dev/mobile launch-arguments.test.ts + engine.test.ts 253 passed, e2e config.test.ts 100 passed. Typecheck clean for core, e2e (incl. tests/types/sdk-types.ts), mobile (incl. tests/types/options.ts), web. oxlint clean. check-docs-translations (162 pages), check-changeset-bumps, check-peer-ranges all pass.
  • Mutants, each caught by at least one test: openApp skips validation, Android allows an empty item / empty list / trailing backslash, iOS skips quoting or quote escaping, fraction as --ei, 2^53 bound removed, undefined skip removed, empty name allowed, whitespace in name allowed, NUL check on object values removed.
  • NSUserDefaults probe: bare YES stays the string "YES" (boolForKey true), "(draft)" quoted is a string, unquoted (draft) is an array, '' is an empty string. So cubic's plist-literal finding is not real, and the quoting rules are correct except for the leading -.
  • Open cubic threads: --el range is fixed. Peer range: not real, since npm has only 0.0.0 and 0.23.2-nightly prereleases of @e2e-dev/core, and none of them satisfies >=0.23.2. Benchmark Android assertion: moot, the file is gone. ja/zh untranslated prose: fine, as agreed.
  • CI: light checks green. docs translations, spec, mobile, docs, benchmark are waiting on approval (action_required) as a fork PR and have not run yet.

@luke-h1
luke-h1 force-pushed the @luke-h1/feat/launch-arguments branch from 9e6c141 to 856914c Compare November 19, 2026 15:37
@luke-h1

luke-h1 commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

[claude-opus-5-5] automated review on behalf of @okwasniewski

Re-checked 9e6c141 (and a local merge with main 66d07ca, clean). Every ask from the last review is done: --ez in docs/mobile.mdx, ja/zh code blocks mirrored (translation check passes), device.openApp now runs checkLaunchArguments plus the Android rules with INVALID_ARGUMENT before any device command, 1e19 can't reach --el any more (2^53 bound), Apple list widened, Detox sentence added, hand-run benchmark check dropped. You're right about --esa: Intent.parseCommandArgs never strips the backslash, so refusing comma/backslash/empty items is the right fix. Thanks.

Must fix

  • packages/mobile/src/launch-arguments.ts:91 and :98 - on iOS, a value that starts with - gets dropped. NSUserDefaults reads -offset -1 as two keys, so { offset: -1 } or { mode: '-x' } reaches the app as nil, and nothing reports it. I checked this with a Foundation binary on the macOS host (same CFPreferences argument parser): ./p -n -1 gives n = nil, ./p -n '"-1"' gives n = "-1", and -l '(-1, b)' works because list items are fine. Fix: send numbers through plistString too, and quote any string that starts with - (for example, drop - from the leading character PLIST_UNQUOTED allows). Add -1 and '-x' iOS cases to launch-arguments.test.ts.

Should fix

  • packages/core/src/types.ts:1259 - LaunchArguments allows undefined values, and EngineAppInfo.launchArguments and the resolved app use that same type, even though checkLaunchArguments already strips them. So every engine still has to handle value === undefined (launchArgumentList and assertLaunchArgumentsFor both do). Have checkLaunchArguments return a narrower resolved type (readonly string[] | Readonly<Record<string, LaunchArgumentValue>>) and use it for EngineAppInfo, ResolvedApp, and the value launchArgumentsForOpen returns. Keep the wide type only on input (TargetApp, OpenAppOptions). Then the engine-side undefined branches go away.

Nits

  • packages/core/src/internal/launch-arguments.ts:60 - the array branch of isLaunchArgumentValue never runs, because checkLaunchArguments handles arrays before it gets there. Narrow the function to scalars.
  • fail(code, message) appears twice, in core and mobile. Fine for now, but if a third copy shows up, export it from core.
  • docs/migrate/detox.mdx:46 - Detox on Android puts launch args into the activity intent as string values inside a launchArgs bundle extra (getIntent().getBundleExtra("launchArgs"), see ActivityLaunchHelper.kt in detox 20.51.4), not only as instrumentation arguments. Something like "Detox nests them as strings in a launchArgs bundle" would be more exact.
  • The changeset covers internals (plist quoting rules, the checkLaunchArguments export). It could stop at the object form, the per-platform spelling, and the Android refusals.

Verified

  • On the merge with main: @e2e-dev/mobile launch-arguments.test.ts + engine.test.ts 253 passed, e2e config.test.ts 100 passed. Typecheck clean for core, e2e (incl. tests/types/sdk-types.ts), mobile (incl. tests/types/options.ts), web. oxlint clean. check-docs-translations (162 pages), check-changeset-bumps, check-peer-ranges all pass.
  • Mutants, each caught by at least one test: openApp skips validation, Android allows an empty item / empty list / trailing backslash, iOS skips quoting or quote escaping, fraction as --ei, 2^53 bound removed, undefined skip removed, empty name allowed, whitespace in name allowed, NUL check on object values removed.
  • NSUserDefaults probe: bare YES stays the string "YES" (boolForKey true), "(draft)" quoted is a string, unquoted (draft) is an array, '' is an empty string. So cubic's plist-literal finding is not real, and the quoting rules are correct except for the leading -.
  • Open cubic threads: --el range is fixed. Peer range: not real, since npm has only 0.0.0 and 0.23.2-nightly prereleases of @e2e-dev/core, and none of them satisfies >=0.23.2. Benchmark Android assertion: moot, the file is gone. ja/zh untranslated prose: fine, as agreed.
  • CI: light checks green. docs translations, spec, mobile, docs, benchmark are waiting on approval (action_required) as a fork PR and have not run yet.

[claude-opus-5-5] automated reply on behalf of @luke-h1 (drafted with Claude, reviewed by @luke-h1)

Thanks - I've rebased with main and pushed a fix per commit:

  • 7982cc2 leading - on iOS: numbers go through plistString too, and a value starting with - is quoted. -1, -0.5, '-x' and a -x list item are in launch-arguments.test.ts
  • d914037 checkLaunchArguments returns ResolvedLaunchArguments (no undefined), used by EngineAppInfo, ResolvedApp and launchArgumentsForOpen. The wide type stays on TargetApp and OpenAppOptions, and the engine-side undefined branches are gone. Engine reference updated in en/ja/zh
  • 96e2097 isLaunchArgumentScalar instead of the dead array branch
  • 782dfe9 Detox row now says it nests them as strings in a launchArgs bundle extra
  • 856914c changeset cut down to the object form, the per-platform spelling and the Android refusals

Left fail as two copies like you said.

Ran it on a simulator (iOS 26.1) and an Android emulator with a small probe test script that reads each value with the typed getter (UserDefaults / Intent) and shows it on screen. List and object form on the target, and both through device.openApp, 8/8 passed. With the old quoting put back, the iOS object target fails on offset=-1, so the device check catches the bug you found.

pnpm check and pnpm test (Node 24) green after the rebase.

Two things I'd like your feedback on 🤔:

  1. EngineAppInfo.launchArguments is now string[] | object. CONTRIBUTING counts widening a type core hands to engines as breaking, and @e2e-dev/core / e2e are on npm at 0.24.0 now, so a third-party engine reading it as string[] would break. I can keep it non-breaking by having core spell the object into the platform's string[] before the engine sees it, so EngineAppInfo stays as it is. Or mark the PR breaking. WDYT?

  2. My earlier reply on the peer-range thread said no core release had happened. That's no longer true: mobile peers on @e2e-dev/core >=0.23.2, and 0.24.0 doesn't export checkLaunchArguments. Does the release bump that or should this PR? 🤔

@okwasniewski
okwasniewski dismissed stale reviews from themself November 19, 2026 16:24

Superseded by the latest automated re-check.

@okwasniewski okwasniewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[claude-opus-5-5] automated review on behalf of @okwasniewski

Re-checked 856914c (and a local merge with main 8eb3cc2, clean). Every ask from the last review is done: numbers and --leading strings go through plistString on iOS, with -1, -0.5, '-x' and a -x list item tested; checkLaunchArguments returns ResolvedLaunchArguments and the engine-side undefined branches are gone; isLaunchArgumentScalar replaces the dead array branch; the Detox row names the launchArgs bundle; the changeset is trimmed. Thanks, and thanks for the device run.

Must fix

  • packages/mobile/package.json:75 and :77 - the peers still say @e2e-dev/core >=0.23.2 and e2e >=0.23.2, but launch-arguments.ts imports checkLaunchArguments from @e2e-dev/core/engine, and the published @e2e-dev/core@0.24.0 has no such export (checked the npm tarball). A user who updates @e2e-dev/mobile alone and keeps e2e@0.24.0 (which pins core 0.24.0) gets a module-load SyntaxError the moment their config imports mobile(). This answers your second question: the floor belongs in this PR. Raise both to >=0.24.1 <1.

Should fix

  • .changeset/launch-arguments-object.md:5 - '@e2e-dev/web': patch releases a package this PR does not change (no file under packages/web). check-changeset-bumps passes without that line, so remove it.

On your first question (EngineAppInfo.launchArguments widening)

Having core turn the object into a string[] would move the platform spelling (-name value vs --ez/--esa extras) into core, which has no idea which platform it is writing for. That logic belongs to the engine, and the PR already puts it there. Whether the widened type counts as breaking is a maintainer call. At runtime an engine only gets an object when its user writes the new form, so existing configs behave as before. Leave the PR as is until @okwasniewski decides.

Nits

  • packages/core/src/engine/index.ts is at 999 lines after this PR (998 on main). Not your problem, but the next export added there will cross the 1000-line limit.

Verified

  • On the merge with main: @e2e-dev/mobile launch-arguments.test.ts + engine.test.ts: 260 passed. e2e config.test.ts: 104 passed. Typecheck clean for core, e2e, mobile, and web. oxlint, check-docs-translations, check-peer-ranges, check-changeset-bumps, and check-error-codes all clean.
  • Mutants, each caught by one test: leading - allowed unquoted in PLIST_UNQUOTED, iOS numbers sent raw instead of through plistString.
  • launch() app overrides go through the same checkTargetApp path, so the object form is checked there too.
  • cubic did not review this head (its incremental review failed to start). Earlier cubic threads stay as resolved last round.
  • CI: only the light checks ran (check, label, drop, review-label, pr-size, pr-policy: green; cubic: neutral). mobile, docs translations, spec, and docs are action_required: this is a fork PR and they wait on maintainer approval.

Two maintainer calls are still open: the Android number mapping ({ ratio: 1.0 } still sends --ei) and whether the EngineAppInfo widening is breaking.

@luke-h1
luke-h1 force-pushed the @luke-h1/feat/launch-arguments branch from 856914c to 8d2a3ab Compare November 21, 2026 17:35
@github-actions github-actions Bot added size:L Up to 499 changed lines, not counting tests, fixtures, translated docs, or the lockfile and removed size:XL Up to 999 changed lines, not counting tests, fixtures, translated docs, or the lockfile labels Nov 21, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 3 files (changes from recent commits).

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

Requires human review: Auto-approval skipped because cubic reviewed only this push, not the earlier force-push. Comment @cubic review to review the whole pull request.

View guided diff | Re-trigger cubic

@luke-h1
luke-h1 force-pushed the @luke-h1/feat/launch-arguments branch from 21800ed to deabd19 Compare November 21, 2026 19:16
@luke-h1

luke-h1 commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

[claude-opus-5-5] automated review on behalf of @okwasniewski

Re-checked 856914c (and a local merge with main 8eb3cc2, clean). Every ask from the last review is done: numbers and --leading strings go through plistString on iOS, with -1, -0.5, '-x' and a -x list item tested; checkLaunchArguments returns ResolvedLaunchArguments and the engine-side undefined branches are gone; isLaunchArgumentScalar replaces the dead array branch; the Detox row names the launchArgs bundle; the changeset is trimmed. Thanks, and thanks for the device run.

Must fix

  • packages/mobile/package.json:75 and :77 - the peers still say @e2e-dev/core >=0.23.2 and e2e >=0.23.2, but launch-arguments.ts imports checkLaunchArguments from @e2e-dev/core/engine, and the published @e2e-dev/core@0.24.0 has no such export (checked the npm tarball). A user who updates @e2e-dev/mobile alone and keeps e2e@0.24.0 (which pins core 0.24.0) gets a module-load SyntaxError the moment their config imports mobile(). This answers your second question: the floor belongs in this PR. Raise both to >=0.24.1 <1.

Should fix

  • .changeset/launch-arguments-object.md:5 - '@e2e-dev/web': patch releases a package this PR does not change (no file under packages/web). check-changeset-bumps passes without that line, so remove it.

On your first question (EngineAppInfo.launchArguments widening)

Having core turn the object into a string[] would move the platform spelling (-name value vs --ez/--esa extras) into core, which has no idea which platform it is writing for. That logic belongs to the engine, and the PR already puts it there. Whether the widened type counts as breaking is a maintainer call. At runtime an engine only gets an object when its user writes the new form, so existing configs behave as before. Leave the PR as is until @okwasniewski decides.

Nits

  • packages/core/src/engine/index.ts is at 999 lines after this PR (998 on main). Not your problem, but the next export added there will cross the 1000-line limit.

Verified

  • On the merge with main: @e2e-dev/mobile launch-arguments.test.ts + engine.test.ts: 260 passed. e2e config.test.ts: 104 passed. Typecheck clean for core, e2e, mobile, and web. oxlint, check-docs-translations, check-peer-ranges, check-changeset-bumps, and check-error-codes all clean.
  • Mutants, each caught by one test: leading - allowed unquoted in PLIST_UNQUOTED, iOS numbers sent raw instead of through plistString.
  • launch() app overrides go through the same checkTargetApp path, so the object form is checked there too.
  • cubic did not review this head (its incremental review failed to start). Earlier cubic threads stay as resolved last round.
  • CI: only the light checks ran (check, label, drop, review-label, pr-size, pr-policy: green; cubic: neutral). mobile, docs translations, spec, and docs are action_required: this is a fork PR and they wait on maintainer approval.

Two maintainer calls are still open: the Android number mapping ({ ratio: 1.0 } still sends --ei) and whether the EngineAppInfo widening is breaking.

Thanks for the pass - fingers crossed this should be the last round of fixes 🫡

bumped e2e to >=0.24.1 < 1
removed the stray @e2e-dev/web patch from the changeset
@e2e-dev/desktop #1953 desktop support was merged, which still read the launch args as a list, so I've made the object format work there too 👍

@okwasniewski okwasniewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[claude-opus-5-5] automated review on behalf of @okwasniewski

Re-checked deabd19 (based on main c30354f, no conflicts). Both asks from the last review are done: the e2e peer floor in @e2e-dev/mobile is raised next to core's, and the @e2e-dev/web changeset line is gone. The new desktop commits look right: desktop() spells an object the same way iOS does, and both launch paths (agent-desktop launch and open --args) are covered. Thanks.

Must fix

None.

Should fix

  • packages/mobile/package.json:75 and :77 - >=0.24.1 <1 is safe, but 0.24.1 will never ship: the pending release (#1974) goes from 0.24.0 straight to 0.25.0 for @e2e-dev/core and e2e. Please change both to >=0.25.0 <1 so the floor names a release that exists.
  • packages/desktop/src/launch-arguments.ts:4-30 copies PLIST_UNQUOTED, plistString, and the -name value spelling from packages/mobile/src/launch-arguments.ts (iosArgument) word for word. These rules are subtle: the leading - quoting took a whole round to get right. With two copies, the next fix will land in one and miss the other. One home for the NSUserDefaults spelling would fix that, for example an appleUserDefaults(launchArguments) export from @e2e-dev/core/engine that both engines call. That would make desktop's core floor >=0.25.0 too. If @okwasniewski would rather keep core free of Apple spelling, keep the copies but have each one point to the other in a comment.

Verified

  • @e2e-dev/desktop launch-arguments.test.ts + surface.test.ts: 113 passed (the appPath test runs on darwin). @e2e-dev/mobile launch-arguments.test.ts + engine.test.ts: 292 passed. e2e config.test.ts: 104 passed.
  • Typecheck clean for core, e2e, mobile, desktop, and web. oxlint, check-changeset-bumps, check-peer-ranges, check-docs-translations, check-error-codes, and check-docs-examples all clean.
  • Mutants on desktop, each caught: a leading - allowed unquoted (the unit test fails), and booleans sent as true/false instead of YES/NO (the unit test and both surface tests fail).
  • Desktop imports only types from @e2e-dev/core/engine, so its >=0.23.2 peers still hold as written.
  • cubic reviewed only the last push (0 issues) and has no open threads.
  • CI on deabd19 after approval: build, check, web, docs, docs translations, bun, install, benchmark, and the gates are green. test (Node 22/24/26), mobile, spec, and android/ios deterministic were still running at the time of this review.

Two maintainer calls are still open: the Android number mapping ({ ratio: 1.0 } still sends --ei), and whether widening EngineAppInfo breaks anything. On the second: a new e2e with an object form, paired with an older @e2e-dev/mobile (or a third-party engine) that spreads app.launchArguments, fails with a TypeError (not iterable) and no config error.

@okwasniewski
okwasniewski dismissed their stale review November 21, 2026 22:18

Superseded by the latest automated re-check.

@okwasniewski okwasniewski added the Ready for Human Review Green, conflict-free, every thread handled. Waiting on a maintainer. label Nov 21, 2026
NSUserDefaults reads `-offset -1` as two keys, so `{ offset: -1 }` or `{ mode: '-x' }` reached the app as nil. Numbers now go through plistString too, and a value starting with `-` is quoted.
checkLaunchArguments already drops undefined entries, so it now returns ResolvedLaunchArguments, used by EngineAppInfo, ResolvedApp and openApp. The undefined branches in the mobile spelling go away.
Also scopes the config reference's table link to iOS and Android.
Mobile and desktop each carried a copy of the plist quoting rules. Both now call appleUserDefaults from @e2e-dev/core/engine, so a fix lands in one place.
A list item starting with // opened an old-style plist comment, so the
whole list read back as nil. A name like -AppleLocale went out as
--AppleLocale and never reached the app's locale. Adds tests for the
Android int32 bounds and empty-string quoting, and notes in the migration
docs that an app reading raw process arguments should keep the list form.
The message now says what to do and why: the engine adds the dash.
The iOS bullet in the mobile reference gets a list-form config for an app
that reads ProcessInfo.processInfo.arguments, and the Detox config passes
the same launch argument on both platforms. Every launch-argument code
block is mirrored into the translations: the Detox config and the new
block in ja and zh, appleUserDefaults in the ja and zh engine reference,
and the object form of the language example in cs, es, pt, hi, and fr.
@luke-h1
luke-h1 force-pushed the @luke-h1/feat/launch-arguments branch from 78df7df to 6b43448 Compare November 23, 2026 17:19

@michal-e2e michal-e2e left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drafted by an AI agent and posted autonomously on Michal's behalf, without him reading it first.

Reviewed at 6b434480b, with 0007636f0 as the merge base.

Thanks for the follow-up, Luke. The Apple list now reads back correctly, and the dashed-key diagnostic, integer boundaries, empty string coverage, and raw-argument migration guidance are in place. The engine compatibility decision is the remaining merge blocker.

Must fix

  • Keep EngineAppInfo.launchArguments iterable for existing engines. From the built core I launched a custom engine that spreads app.launchArguments. The list form completed. Passing { AppleLocale: 'fr_FR', AppleLanguages: ['fr'] } sent an object to the existing lifecycle receiver, which failed with “not iterable.” The unchanged spread also fails to compile against the new declaration. Published mobile 0.12.8 uses that same spread, and its peer ranges admit a newer runner and core. I'd keep the existing list field and deliver the map through an opt-in field or conversion hook. An engine without support should reject the map at config load. Add a test using an existing array-consuming engine and a round-trip test for the new engine path. If we deliberately break the contract, that needs the maintainer's decision under the stability policy. Public field · Stability policy

Optional

  • The engine reference should mention that argument names cannot start with a dash and that a string starting with // is quoted, including inside a list. The implementation and tests already do this. Engine reference

  • Please bring the PR description up to this head. Mention the desktop support, shared encoder, and dashed-name rejection, and label the verification evidence with the revision each run used.

For the maintainer

  • If the engine contract changes, the current release rule requires a changeset for every engine. The PR omits web because the earlier review asked Luke to remove it. Please confirm the exception or restore the web entry. Also, #1974 still plans core 0.25.0 without the new helpers. If it ships first, mobile and desktop need the first core version that actually exports the helpers. Release rule · Version packages PR
  • Android extras are still a scope decision. A JavaScript 1.0 is sent as an integer, so it will not satisfy getFloatExtra. Keeping the feature is reasonable if the docs tell Android callers to use raw --ef when the app expects a float even at whole-number values. The original issue requested the map and preserving the list form. Android encoder · Original issue

Verified

  • The built merge base accepts the list form and rejects the map at configuration load. The candidate sends the map over the existing engine protocol. The unchanged array spread fails in TypeScript and at runtime on that map. Published core 0.24.0 and the built merge base compile the same spread.
  • macOS Foundation read no list on the previous revision and read the exact two strings on the candidate. The iOS 27.2 simulator read the list through configured launch and device.openApp. The Android 15 emulator read the expected extra types. Both platforms passed an equivalent raw-list control and rejected the dashed key.
  • pnpm check, the testbed, and the deterministic web benchmark passed. pnpm test stopped at one desktop timing assertion. The focused version of that test passed on the candidate and merge base, and all later package commands passed when run separately.
  • The offline web agent suite had eight failures on each revision. Seven listed test titles matched, one changed between revisions, and the logs reported model provider failures. The full mobile benchmark recorded 117 passed, six failed and two skipped, with the failures on iOS. Neither result is a clean release gate. I did not run the full mobile benchmark against the merge base, so those failures are unclassified.
  • All six targeted mutations for Apple quoting, dashed names and Android integer limits were caught by tests. The base-control tool could not load two new test files because their implementation modules do not exist on the base. The other seven new tests it could evaluate failed there.
  • GitHub's benchmark, mobile, spec and docs workflows still require maintainer authorization.

These are my review findings. The approval is @okwasniewski's.

…rough launchArgumentValues

An engine that spreads app.launchArguments broke when a target passed an
object, and the spread stopped compiling against the widened type.

launchArguments is a string list again. The object form goes to a new
EngineAppInfo.launchArgumentValues, only for engines that declare
launchArgumentValues: true (carried through defineEngine and the
manifest). Any other engine gets INVALID_CONFIG at config load, so
published mobile 0.12.8 on a newer core refuses the object instead of
crashing. mobile() and desktop() opt in.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 29 files (changes from recent commits).

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

Requires human review: Auto-approval skipped because cubic reviewed only this push, not the earlier force-push. Comment @cubic review to review the whole pull request.

View guided diff | Re-trigger cubic

Comment thread docs/reference/engine.mdx Resolved
Comment thread .changeset/launch-arguments-object.md Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 2 files (changes from recent commits).

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

Requires human review: Auto-approval skipped because cubic reviewed only this push, not the earlier force-push. Comment @cubic review to review the whole pull request.

View guided diff | Re-trigger cubic

@luke-h1

luke-h1 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Drafted by an AI agent and posted autonomously on Michal's behalf, without him reading it first.

Reviewed at 6b434480b, with 0007636f0 as the merge base.

Thanks for the follow-up, Luke. The Apple list now reads back correctly, and the dashed-key diagnostic, integer boundaries, empty string coverage, and raw-argument migration guidance are in place. The engine compatibility decision is the remaining merge blocker.

Must fix

  • Keep EngineAppInfo.launchArguments iterable for existing engines. From the built core I launched a custom engine that spreads app.launchArguments. The list form completed. Passing { AppleLocale: 'fr_FR', AppleLanguages: ['fr'] } sent an object to the existing lifecycle receiver, which failed with “not iterable.” The unchanged spread also fails to compile against the new declaration. Published mobile 0.12.8 uses that same spread, and its peer ranges admit a newer runner and core. I'd keep the existing list field and deliver the map through an opt-in field or conversion hook. An engine without support should reject the map at config load. Add a test using an existing array-consuming engine and a round-trip test for the new engine path. If we deliberately break the contract, that needs the maintainer's decision under the stability policy. Public field · Stability policy

Optional

  • The engine reference should mention that argument names cannot start with a dash and that a string starting with // is quoted, including inside a list. The implementation and tests already do this. Engine reference
  • Please bring the PR description up to this head. Mention the desktop support, shared encoder, and dashed-name rejection, and label the verification evidence with the revision each run used.

For the maintainer

  • If the engine contract changes, the current release rule requires a changeset for every engine. The PR omits web because the earlier review asked Luke to remove it. Please confirm the exception or restore the web entry. Also, chore: version packages #1974 still plans core 0.25.0 without the new helpers. If it ships first, mobile and desktop need the first core version that actually exports the helpers. Release rule · Version packages PR
  • Android extras are still a scope decision. A JavaScript 1.0 is sent as an integer, so it will not satisfy getFloatExtra. Keeping the feature is reasonable if the docs tell Android callers to use raw --ef when the app expects a float even at whole-number values. The original issue requested the map and preserving the list form. Android encoder · Original issue

Verified

  • The built merge base accepts the list form and rejects the map at configuration load. The candidate sends the map over the existing engine protocol. The unchanged array spread fails in TypeScript and at runtime on that map. Published core 0.24.0 and the built merge base compile the same spread.
  • macOS Foundation read no list on the previous revision and read the exact two strings on the candidate. The iOS 27.2 simulator read the list through configured launch and device.openApp. The Android 15 emulator read the expected extra types. Both platforms passed an equivalent raw-list control and rejected the dashed key.
  • pnpm check, the testbed, and the deterministic web benchmark passed. pnpm test stopped at one desktop timing assertion. The focused version of that test passed on the candidate and merge base, and all later package commands passed when run separately.
  • The offline web agent suite had eight failures on each revision. Seven listed test titles matched, one changed between revisions, and the logs reported model provider failures. The full mobile benchmark recorded 117 passed, six failed and two skipped, with the failures on iOS. Neither result is a clean release gate. I did not run the full mobile benchmark against the merge base, so those failures are unclassified.
  • All six targeted mutations for Apple quoting, dashed names and Android integer limits were caught by tests. The base-control tool could not load two new test files because their implementation modules do not exist on the base. The other seven new tests it could evaluate failed there.
  • GitHub's benchmark, mobile, spec and docs workflows still require maintainer authorization.

These are my review findings. The approval is @okwasniewski's.

thanks, good catch. I've fixed this in 7f4a2f2 and 5a7b87a.

  • EngineAppInfo.launchArguments is readonly string[] again, so existing engines keep spreading it. sdk-types.ts now pins that the spread compiles successfully.
  • The object form goes through a new opt-in field in the engine, EngineAppInfo.launchArgumentValues, sent only to engines that declare launchArgumentValues: true. The flag goes through defineEngine, the engine manifest and its schema, and the protocol client. mobile() and desktop() opt in.
  • An engine without the flag gets INVALID_CONFIG at config load: app.launchArguments is an object, and engine "<name>" takes only a list of strings: write the arguments as a list, or use an engine version that supports the object syntax
  • Tests: in engine-protocol.test.ts, a list-only engine spreads the list in validateApp and prepare and has the object refused before it reaches the engine. A round trip handles both formats to an engine that opts in. The mobile and desktop tests fail if either engine stops opting in.
  • Checked by hand against the packed core and e2e: a custom engine that spreads app.launchArguments passes e2e run with a list and gets INVALID_CONFIG for { AppleLocale: 'fr_FR', AppleLanguages: ['fr'] }. Published @e2e-dev/mobile@0.12.8 does the same with e2e list.
  • The existing field keeps its type, so nothing breaks under the stability policy.
  • The engine reference now covers the dash rule and the // quoting, including inside a list.

One small nitpick I found during testing. It's existing behaviour, so it could be a follow-up for a cleaner experience. If a web user provides launchArguments as an object, they get told to write it as a list of strings:

{ name: 'chromium', engine: web(), app: { url: 'http://localhost:3000', launchArguments: { AppleLocale: 'fr_FR' } } }
Version What the user gets
main target "chromium" app.launchArguments must be an array of strings
This PR before your review target "chromium" declares app.launchArguments, which describes an installed device app; a web() target opens app.url
This PR now target "chromium" app.launchArguments is an object, and engine "web" takes only a list of strings: write the arguments as a list, or use an engine version that supports the object syntax

So a user or agent has to go through two steps to fix it:

  1. They get the "array of strings" error (main) or the "is an object" error (this PR), rewrite the field as a list, and run again.
  2. They then get declares app.launchArguments, which describes an installed device app; a web() target opens app.url. That message is clear, so they remove the field or move the values into the URL.

So this PR behaves much like main, but it still sends users and agents on a detour. If you'd like, @michal-e2e, we could fix it with one change in two parts (appreciate there's been a lot of back and forth on this PR, so happy to do it in another PR if that's easier):

  1. Core (packages/core/src/config/app.ts): move the opt-in check after the engine?.validateApp?.(...) call. Each engine then sees the declaration first, and can refuse an object with its own reason.
  2. Web (packages/web/src/engine.ts): in the NATIVE_APP_KEYS loop, handle app.launchArgumentValues the same as app.launchArguments. A web target with a list or an object can get a custom error

@okwasniewski okwasniewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[claude-opus-5-5] automated review on behalf of @okwasniewski

Re-checked 5a7b87a (merge base 0007636, merges cleanly with main 51cbd2e). @michal-e2e's must-fix is done. EngineAppInfo.launchArguments is a readonly string[] again. The object form now goes to a new EngineAppInfo.launchArgumentValues, and only engines that set launchArgumentValues: true get it. The flag goes through defineEngine, the manifest, its schema, and the protocol client. Any other engine gets INVALID_CONFIG at config load. mobile() and desktop() opt in, and both read launchArgumentValues ?? launchArguments everywhere they launch. Our earlier asks are still in place. The mobile and desktop floors on core/e2e are >=0.25.0 <1, and #1974 is still open, so 0.25.0 will ship this. Thanks for the quick turnaround.

Must fix

None.

Should fix

None.

Nits

  • packages/core/src/internal/launch-arguments.ts:61: launchArguments as LaunchArgumentValues is there only because Array.isArray does not narrow a readonly string[] union. A small isLaunchArgumentList type guard would remove the cast.
  • docs/reference/mobile.mdx:386 / docs/reference/config.mdx:520: a whole-number value such as 1 or 1.0 goes out as --ei, so getFloatExtra never reads it. One sentence telling Android callers to use the raw list (['--ef', 'scale', '1.0']) when the app reads a float would save someone a debugging session.
  • The web detour you described (an object on a web() target first gets "takes only a list", then "opens app.url") is fine as a follow-up. Moving the opt-in check after validateApp would fix it.

Verified

  • Built core and e2e at 5a7b87a, then ran e2e run on a scratch project with a custom engine that spreads app.launchArguments in validateApp, prepare, and init. With ['-AppleLocale', 'fr_FR'] the test passed, and all four hooks spread the list. With { AppleLocale: 'fr_FR', AppleLanguages: ['fr'] } the run stopped at config load with target "t" app.launchArguments is an object, and engine "legacy" takes only a list of strings: ..., before any engine hook ran. The same engine with launchArgumentValues: true received { AppleLocale, AppleLanguages, on: true, n: 3 } (the undefined entry dropped) in launchArgumentValues only, and launchArguments was absent.
  • Published @e2e-dev/mobile 0.12.8 (npm pack) does not set the flag and spreads this.app.launchArguments, so on this core it gets the config-load refusal instead of crashing.
  • Tests: e2e config.test.ts + engine-protocol.test.ts 172 passed. @e2e-dev/mobile launch-arguments.test.ts + engine.test.ts 319 passed. @e2e-dev/desktop launch-arguments, surface, and engine tests 180 passed, 1 skipped.
  • Typecheck is clean for core, e2e (including sdk-types.ts), mobile, desktop, and web. oxlint, check-peer-ranges, check-changeset-bumps, check-error-codes, check-examples, and plugins:check are clean too.
  • Mutants, each caught: removing the opt-in check in config/app.ts (1 fail), dropping the flag in the protocol client (2) or in describeEngine (2), putting the object in launchArguments (1), and removing launchArgumentValues: true from mobile (1) or desktop (1).
  • No source file this PR touches goes past 1000 lines for the first time. types.ts, both surface.ts files, and the large test files were already over the limit on main and grow by 1 to 76 lines.
  • cubic: 0 open findings on the last two pushes.
  • CI on 5a7b87a: check, pr-policy, and labels are green. spec, mobile, benchmark, docs, and docs translations are action_required (fork runs waiting for maintainer approval), so test/mobile/docs CI has not run on this head yet.

@okwasniewski okwasniewski added the Ready for Human Review Green, conflict-free, every thread handled. Waiting on a maintainer. label Nov 24, 2026

@kdy1 kdy1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

This text was drafted with AI and posted after human approval.

  • Harness: T3 Code
  • AI agents: coordinator: Claude Opus 5.5 (claude-opus-5-5), reviewer: GPT-6.2 Astra (gpt-6.2-astra), reviewer: GPT-6.2 Sol (gpt-6.2-sol), reviewer: Claude Opus 5.5 (claude-opus-5-5), reviewer: Claude Sonnet 5.5 (claude-sonnet-5-5)

Verdict: Approve

This review approves the pull request. The P3 items are optional and do not block the merge.

This pull request lets app.launchArguments and device.openApp({ launchArguments }) take an object of argument name to value. mobile() spells the object as -name value user defaults on iOS and as typed am start extras on Android, and desktop() uses the Apple form. The engine contract stays backward compatible: EngineAppInfo.launchArguments is still a list, and only an engine that declares launchArgumentValues: true gets the object. I reviewed the head at 5a7b87a. I built core, e2e, mobile, desktop, and web. The targeted unit tests passed (mobile 319, desktop 180 with 1 skipped, e2e config, protocol, and schema 211), and the package typechecks passed. The same inputs ran on the base and on the head. The iOS locale object fails with INVALID_CONFIG on the base and works on the head. An existing list gives the same arguments on both sides. The generated iOS arguments were also read back through macOS Foundation UserDefaults, and every value arrived as written. The branch merges cleanly with the current main. I found three small, non-blocking problems, listed below.

Reviewed commit: 5a7b87a1877a015a334aa3a00835931c1a47c3a1

  • P3 (non-blocking): 3 (3 inline)

if (launchArguments !== undefined && (!Array.isArray(launchArguments) || !launchArguments.every((argument) => typeof argument === 'string'))) {
throw new ConfigurationError('INVALID_CONFIG', `${where}.launchArguments must be an array of strings`);
const launchArguments = checkLaunchArguments(`${where}.launchArguments`, app.launchArguments);
if (launchArguments !== undefined && !Array.isArray(launchArguments) && engine !== undefined && engine.launchArgumentValues !== true) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3 · Non-blocking · The object-form error gives wrong advice for an engine that takes no launch arguments

Optional. This does not block the merge.

The check for launchArgumentValues runs before the engine's own validateApp, and it runs for every engine that does not declare the flag.

Trigger: a web() target with app: { url: 'http://localhost:3000', launchArguments: { A: 1 } }.

Result on the built head:

INVALID_CONFIG target "t" app.launchArguments is an object, and engine "web" takes only a list of strings: write the arguments as a list, or use an engine version that supports the object syntax

Both parts of that advice are wrong for web(). If the user writes a list, the next run fails with declares app.launchArguments, which describes an installed device app; a web() target opens app.url (packages/web/src/engine.ts, NATIVE_APP_KEYS). Also, no version of web() takes the object form.

An object whose values are all undefined, for example { A: process.env.UNSET }, gets the same message. The LaunchArguments docs say that such an entry is left out, so nothing would be sent.

On the base, both inputs also fail, but with must be an array of strings. This is a problem with the message only. No launch behavior changes.

return Object.fromEntries(entries);
}

export function engineLaunchArguments(launchArguments: ResolvedLaunchArguments | undefined): {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3 · Non-blocking · Four new exported functions have no JSDoc

Optional. This does not block the merge.

AGENTS.md asks for "JSDoc on new functions". These new exports have no doc comment, but the other new functions in the same files have one:

  • engineLaunchArguments (packages/core/src/internal/launch-arguments.ts:56)
  • launchArgumentsForOpen (packages/mobile/src/launch-arguments.ts:23)
  • launchArgumentList (packages/mobile/src/launch-arguments.ts:59)
  • launchArgumentList (packages/desktop/src/launch-arguments.ts:3)

"description": "prepare binds the device e2e run --device names.",
"type": "boolean"
},
"launchArgumentValues": {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3 · Non-blocking · The invalid manifest fixture does not cover the new launchArgumentValues field

Optional. This does not block the merge.

AGENTS.md says that a wire change edits the schema, both fixtures, and the producer in one review. This change adds launchArgumentValues to the schema and to engine-manifest-v1.valid.json, but engine-manifest-v1.invalid.json still exercises only a duplicate action. If the schema stopped checking the type of this field, the fixture tests would still pass. The schema rejects "yes" today, so this is a coverage gap, not a wrong result.

Note: #2002 added selectsDevice in the same way (schema and valid fixture only), so this follows existing practice. A maintainer can decide whether the rule applies to plain boolean fields.

@kdy1
kdy1 added this pull request to the merge queue Nov 24, 2026
Merged via the queue into e2e-inc:main with commit 11de64b Nov 24, 2026
32 checks passed
okwasniewski pushed a commit to abhinavapasok/e2e that referenced this pull request Nov 25, 2026
…inc#2229)

- github, integrations/index, and the ci/ pages: github-actions,
  gitlab, vercel-previews, eas-workflows, bitrise, codemagic, norrix
- catch up English changes the pt pages were missing: authentication
  (e2e-inc#2131), mobile (e2e-inc#1903, e2e-inc#2192), ci (e2e-inc#2137), web (e2e-inc#2147), cache
  (e2e-inc#2093), models (e2e-inc#2146)
- ci: "step" for a CI step, as on the new pages
- README: glossary rows for the CI terms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready for Human Review Green, conflict-free, every thread handled. Waiting on a maintainer. size:XL Up to 999 changed lines, not counting tests, fixtures, translated docs, or the lockfile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants